﻿using System.Linq;

namespace Silent.API.Ukrbash
{
    public class QueryBuilder
    {
        public const string BASE_URL = "http://ws.audioscrobbler.com/2.0/";

        public string BuildQuery(QueryParameter[] parameters)
        {
            var query = parameters.Aggregate(string.Empty, 
                (current, parameter) => current + string.Format("{0}={1}&", parameter.Name, parameter.Value));
            return string.Format("{0}?{1}", BASE_URL, query);
        }
    }
}